package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Set;

/**
 * 用户实体类
 * @author Zchaolin
 * @version 1.0
 * @created 29-7月-2022 9:34:35
 */
@TableName("t_user")
public class UserBean {

	/**
	 * 用户编号
	 */
	@TableId(value = "pk_userId",type = IdType.AUTO)
	private Integer id;
	/**
	 * 用户名
	 */
	@TableField("u_userName")
	private String userName;
	/**
	 * 真实姓名
	 */
	@TableField("u_realName")
	private String realName;
	/**
	 * 用户密码
	 */
	@TableField("u_pwd")
	private String pwd = "123";
	/**
	 * 用户角色集合
	 */
	@TableField(exist = false)
	private Set<RoleBean> roleSet;
	/**
	 * 用户权限集合
	 */
	@TableField(exist = false)
	private Set<PowerBean> powerSet;

	public UserBean(){

	}

	public UserBean(String userName, String realName) {
		this.userName = userName;
		this.realName = realName;
	}

	public UserBean(String userName, String realName, String pwd) {
		this.userName = userName;
		this.realName = realName;
		this.pwd = pwd;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public Set<RoleBean> getRoleSet() {
		return roleSet;
	}

	public void setRoleSet(Set<RoleBean> roleSet) {
		this.roleSet = roleSet;
	}

	public Set<PowerBean> getPowerSet() {
		return powerSet;
	}

	public void setPowerSet(Set<PowerBean> powerSet) {
		this.powerSet = powerSet;
	}

	@Override
	public String toString() {
		return "UserBean{" +
				"id=" + id +
				", userName='" + userName + '\'' +
				", realName='" + realName + '\'' +
				", pwd='" + pwd + '\'' +
				", roleSet=" + roleSet +
				", powerSet=" + powerSet +
				'}'+"\n";
	}
}